package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.SysUserAccountMapper;
import com.ruoyi.system.domain.SysUserAccount;
import com.ruoyi.system.service.ISysUserAccountService;

/**
 * 用户的账户信息Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-11-18
 */
@Service
public class SysUserAccountServiceImpl implements ISysUserAccountService 
{
    @Autowired
    private SysUserAccountMapper sysUserAccountMapper;

    /**
     * 查询用户的账户信息
     * 
     * @param id 用户的账户信息主键
     * @return 用户的账户信息
     */
    @Override
    public SysUserAccount selectSysUserAccountById(Long id)
    {
        return sysUserAccountMapper.selectSysUserAccountById(id);
    }

    /**
     * 查询用户的账户信息列表
     * 
     * @param sysUserAccount 用户的账户信息
     * @return 用户的账户信息
     */
    @Override
    public List<SysUserAccount> selectSysUserAccountList(SysUserAccount sysUserAccount)
    {
        return sysUserAccountMapper.selectSysUserAccountList(sysUserAccount);
    }

    /**
     * 新增用户的账户信息
     * 
     * @param sysUserAccount 用户的账户信息
     * @return 结果
     */
    @Override
    public int insertSysUserAccount(SysUserAccount sysUserAccount)
    {
        sysUserAccount.setCreateTime(DateUtils.getNowDate());
        return sysUserAccountMapper.insertSysUserAccount(sysUserAccount);
    }

    /**
     * 修改用户的账户信息
     * 
     * @param sysUserAccount 用户的账户信息
     * @return 结果
     */
    @Override
    public int updateSysUserAccount(SysUserAccount sysUserAccount)
    {
        sysUserAccount.setUpdateTime(DateUtils.getNowDate());
        return sysUserAccountMapper.updateSysUserAccount(sysUserAccount);
    }

    /**
     * 批量删除用户的账户信息
     * 
     * @param ids 需要删除的用户的账户信息主键
     * @return 结果
     */
    @Override
    public int deleteSysUserAccountByIds(Long[] ids)
    {
        return sysUserAccountMapper.deleteSysUserAccountByIds(ids);
    }

    /**
     * 删除用户的账户信息信息
     * 
     * @param id 用户的账户信息主键
     * @return 结果
     */
    @Override
    public int deleteSysUserAccountById(Long id)
    {
        return sysUserAccountMapper.deleteSysUserAccountById(id);
    }
}
